package com.sh.controller;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.sh.entity.User;
import com.sh.service.UserService;

/**
 * 测试用的controller
 * */
@RestController
public class HelloController {
	@Autowired
	UserService userService;

	@RequestMapping("/hello")
	public String HelloWorld(
			@RequestParam(value = "name", defaultValue = "World") String name){


		User userByName = userService.getUserByName("张三");

		System.out.println("密码:"+userByName.getPwd());
		return String.format("Hello %s!", name);
	}
}
